package com.tonghu.bluetoothregistration.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.tonghu.bluetoothregistration.fragment.ListDeviceFragment;
import com.tonghu.bluetoothregistration.fragment.ListUserFragment;


/**
 * Created by tonghu on 6/1/15.
 */
public class MainViewPagerAdapter extends FragmentPagerAdapter {

    public MainViewPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment rst = null;
        switch (position) {
            case 0:
                rst = new ListDeviceFragment();
                break;
            case 1:
                rst = new ListUserFragment();
        }
        return rst;
    }

    @Override
    public int getCount() {
        return 2;
    }

}

